package com.szpx.mapper;

import com.szpx.entity.daimingdongentity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author daimingdong
 * @version 2024/4/4 15:08
 * description
 * @title StatementMapper
 **/
@Mapper
public interface StatementMapper {
    // 查询所有入库报表
    @Select("SELECT * FROM stock_in_report")
    List<StockInReport> getAllStockInReports();

    // 查询所有出库报表
    @Select("SELECT * FROM stock_out_report")
    List<StockOutReport> getAllStockOutReports();
    // 查询所有内部报表
    @Select("SELECT * FROM internal_report")
    List<InternalReport> getAllInternalReports();

    // 查询调度统计
    @Select("SELECT * FROM dispatch_statistics")
    List<DispatchStatistics> getDispatchStatistics();

    // 查询收货统计
    @Select("SELECT * FROM receipt_statistics")
    List<ReceiptStatistics> getReceiptStatistics();

    // 搜索进货站报表
    @Select("SELECT * FROM stock_in_report WHERE station_name LIKE CONCAT('%', #{keyword}, '%') OR goods_name LIKE CONCAT('%', #{keyword}, '%')")
    List<StockInReport> searchStockInReports(@Param("keyword") String keyword);


    // 搜索出库站报表
    @Select("SELECT * FROM stock_out_report WHERE station_name LIKE CONCAT('%', #{keyword}, '%') OR goods_name LIKE CONCAT('%', #{keyword}, '%')")
    List<StockOutReport> searchStockOutReports(@Param("keyword") String keyword);


    // 搜索内部报表

    @Select("SELECT * FROM internal_report WHERE station_name LIKE CONCAT('%', #{keyword}, '%') OR operation_type LIKE CONCAT('%', #{keyword}, '%')")
    List<InternalReport> searchInternalReports(@Param("keyword") String keyword);



    // 搜索收件统计
    @Select("SELECT * FROM receipt_statistics WHERE station_name LIKE CONCAT('%', #{keyword}, '%')")
    List<ReceiptStatistics> searchReceiptStatistics(@Param("keyword") String keyword);

    //搜索派件统计
    @Select("SELECT * FROM dispatch_statistics WHERE station_name LIKE CONCAT('%', #{keyword}, '%')")
    List<DispatchStatistics> searchDispatchStatistics(@Param("keyword") String keyword);
}
